<template>
	<view>
		<!-- 1.模块化  node服务端:common.js  前端：es6 -->
		<!-- 2.原型链 -->
		<!-- 3.globalData 小程序 所有平台全部兼容-->
		<!-- 4.缓存 -->
		<button @click="setData">set</button>
		<button @click="getData">get</button>
		<!-- 5.vuex 免安装 直接使用即可-->
		<view class="">年龄是：{{age}}</view>
		<button @click="changeAge(30)">editAge</button>
	</view>
</template>

<script>
	import  URL from "@/utils/config.js"
	console.log(URL)
	
	let app = getApp();
	console.log(app.globalData)
	
	import {mapState,mapMutations}  from "vuex";
	export default {
		data() {
			return {
				
			}
		},
		computed:{
			...mapState(['age'])
		},
		methods: {
			...mapMutations(['changeAge']),
			setData(){
				uni.setStorageSync('info','测试')
			},
			getData(){
				console.log(uni.getStorageSync('info'))
			}
		}
	}
</script>

<style>

</style>
